const fields = [
  {
    dataIndex: 'index',
    key: 'index',
    title: '序号',
    width: 50,
    scopedSlots: {
      customRender: 'subscript'
    }
  },
  {
    dataIndex: 'name',
    key: 'name',
    title: '网点名称',
    width: 250
  },
  {
    dataIndex: 'stationTypeStr',
    key: 'stationTypeStr',
    title: '网点类型',
    width: 150
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    scopedSlots: {
      customRender: 'action'
    }
  }
]

const formRow = [
  {
    span: 10,
    label: '网点名称',
    component: 'AInput',
    placeholder: '请输入栏目名称',
    prop: 'name',
    allowClear: true
  },
  {
    span: 12,
    label: '网点类型',
    component: 'ASelect',
    placeholder: '请选择指引位置',
    prop: 'type',
    loading: false,
    disabled: false,
    isCustomList: true,
    customRequestList(instance) {
      instance.loading = true
      instance.disabled = true
      setTimeout(() => {
        instance.disabled = false
        instance.loading = false
        instance.list = [
          {
            label: '知识产权保护工作站',
            value: '0'
          },
          {
            label: '知识产权纠纷人民调解委员会',
            value: '1'
          },
          {
            label: '知识产权保护中心',
            value: '2'
          },
          {
            label: '知识产权快速维权中心',
            value: '3'
          },
          {
            label: '国家知识产权信息公共服务备案网点',
            value: '4'
          },
          {
            label: '技术与创新支持中心(TISC)',
            value: '5'
          },
          {
            label: '商标品牌培育指导站',
            value: '6'
          }
        ]
      }, 1000)
    },
    allowClear: true
  }
]

const slotOpt = [
  {
    slot: 'action',
    component: 'Action',
    list: [
      { name: '修改', cb: 'edit' },
      { name: '查看', cb: 'toDetail', divider: true }
    ]
  }
]

module.exports = {
  fields,
  formRow,
  slotOpt
}
